<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class MErrorLogs extends MModel {
    
    public static function createErrorLogs($namespace, $memo) {
        $user = MUserManager::getInstance ()->getCurrentUser ();
        $sql = "insert into " . DB_PREFIX . "_error_logs(namespace,memo,";
        $sql .= "appliction_id,";
        $sql .= "created_at,updated_at) values ";
        
        $sql .= "('{$namespace}',";
        $sql .= "'{$memo}',";
        if (isset ( $user->appId )) {
            $sql .= "{$user->appId},";
        } else {
            $sql .= "0,";
        }
        $sql .= "now(),now())";
        FXP::trace ( "function: '{createErrorLogs}',sql:'{$sql}'" );
        $db_manager = MDbManager::getInstance ();
        $result = $db_manager->insertDb ( $sql );
        return $result;
    }
}
?>